<?php

class ProductoController extends AppController {

    /**
     * This controller does not use a model
     *
     * @var array
     */
    public $uses = array('product', 'image');
    public $helpers = array('Html', 'Js', 'Fancybox.Fancybox');

    public function index() {
        $this->layout = 'avenida';        
    }

    public function interior($name, $id) {
        $this->layout = 'avenida';
        /*$this->product->bindModel(array(
			'belongsTo' => array(
			'Images' => array(
			'foreignKey' => false,
			'conditions' => array('product.id = Images.product_id')
		))));*/        
        $producto  = $this->product->findById($id);
        $productos = $this->product->find('all');
        $imagenes = $this->image->find('all', array(
			'conditions' => array(
				'image.product_id' => $id,
			)
        ));
        $this->set('product', $producto);
		$this->set('images', $imagenes);        
        $this->set('products', $productos);
    }

}
